home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////
- //
- // StarDown V1.00 - (!)1996 Larry Monte\StarLab Systems Software
- //
- // MEX: Copyright 1990, 1995 by Lanius Corporation. All rights reserved.
- //
- // DownLoad Command Replacement. Allows local users (sysops) to specify a
- // path to extract tagged files to.
- //
- //
-
- #include <max.mh>
-
- #define DEFAULT_PATH "C:\\ATEMP\\"
-
- // struct _instancedata: id;
-
- void main()
- {
- int: fnum, flags, pos, qsize, ok;
- long: fsize, txtime;
- char: nonstop;
- string: rootname, filescheck, added_filename, new_path, out_path;
-
- ok := 0;
-
- if (id.local = TRUE)
- {
- print("\n");
- reset_more(nonstop);
- qsize := (tag_queue_size());
- for (fnum := 0; fnum < qsize AND do_more(nonstop, COL_CYAN);
- fnum := fnum + 1)
- {
- tag_get_name( fnum, flags, filescheck);
- pos := strridx(filescheck, 0, '\\');
- if (pos=0)
- rootname := filescheck;
- else
- rootname := substr(filescheck, pos+1, strlen(filescheck)-pos+1);
- fsize := filesize(filescheck);
- print("\x16\x01\x0e(", fnum+1, ") \x16\x01\x0d"+strpad(
- rootname,16,' '), ' ', "\x16\x01\x0a("+ltostr(fsize)+
- " Bytes)\n");
- }
- while (ok = 0)
- {
- qsize := (tag_queue_size());
- print(COL_WHITE, "\nFile(s) To DownLoad(#",qsize+1,"): ");
- input_str(added_filename, INPUT_WORD,0,14,"");
- if (added_filename <> "" AND added_filename <> "/q")
- {
- input := "A;"+added_filename;
- menu_cmd(512,"");
- }
- else if (tag_queue_size() > 0 AND added_filename <> "/q")
- {
- print(COL_YELLOW, "Altername Path, Or <ENTER> For Default",
- "(Include Trailing BackSlash)\n : ");
- input_str(new_path,INPUT_WORD,0,80,"");
- if (new_path <> "")
- out_path := new_path;
- else
- out_path := DEFAULT_PATH;
- qsize := (tag_queue_size());
- for (fnum := 0; fnum < qsize; fnum := fnum +1)
- {
- tag_get_name( fnum, flags, filescheck);
- pos := strridx(filescheck, 0, '\\');
- if (pos=0)
- rootname := filescheck;
- else
- rootname := substr(filescheck, pos+1,
- strlen(filescheck)-pos+1);
- filecopy(filescheck,out_path+rootname);
- }
- input := "C;|";
- menu_cmd(512,"");
- ok := 1;
- }
- else if (added_filename = "\e")
- {
- menu_cmd(512,"");
- }
- else
- ok := 1;
- }
- }
- else
- {
- menu_cmd(505,"");
- }
- }
-